<template>
  <el-container>
    <el-header height="60px">
      <div>
        <span>轻量级培养方案管理系统（公众）</span>
      </div>
      <div>
        <el-button type="danger" @click="logout" round icon="el-icon-refresh-right" plain>退出登录</el-button>
      </div>
    </el-header>
    <el-container>
      <el-aside width="250px">
        <el-menu
          class="el-menu-vertical-demo"
          @open="handleOpen"
          @close="handleClose"
          background-color="#545c64"
          text-color="#fff"
          active-text-color="#ffd04b"
          unique-opened
          router
          :collapse-transition="true">

          <el-menu-item index="/welcome"><i class="el-icon-school"></i>课程大纲</el-menu-item>

          <el-submenu index="1">
            <template slot="title"><i class="el-icon-user"></i>培养方案</template>
            <el-menu-item-group>
              <el-menu-item index="/Pub_Profession"><i class="el-icon-house"></i>毕业生能力要求指标</el-menu-item>
              <el-menu-item index="/Semester"><i class="el-icon-files"></i>学期信息</el-menu-item>
            </el-menu-item-group>
          </el-submenu>


        </el-menu>
      </el-aside>
      <el-main>
        <router-view></router-view>
      </el-main>
    </el-container>
  </el-container>

</template>

<script>
export default {
  name: 'home',
  methods: {
    handleOpen(key, keyPath) {
      console.log(key, keyPath);
    },
    handleClose(key, keyPath) {
      console.log(key, keyPath);
    },
    logout(){
      window.sessionStorage.clear();
      this.$router.push({ path: "/login"});
    }
  }
}
</script>

<style scoped>
  .whole_container{
    max-width: 1000px; margin: 0 auto;
  }
.el-header{
  background: lightslategray;
  color: white;
  font-size: 25px;
  align-items: center;
  justify-content: space-between;
  display: flex;
}
.el-aside{
  background-color: lightslategray;
  height: 908px;
}
.el-main{
  background-color: whitesmoke;
}
.el-menu{
    border-right: 0;
}
</style>
